<template>
	<view class="content" :style="{background:$store.state.bgPrimaryColor}">
		<view class="headers">
			<!-- {{info.word || ''}} --> 贵在坚持、难在坚持、成在坚持。
		</view>
		<view class="jiangp">
			<u--image :showLoading="true" src="../../static/jiangp.png" width="674rpx" height="412rpx"
				radius="0"></u--image>
			<text class="_text">A</text>
			<text class="title">非常棒，已熟练掌握学习内容！</text>
			<text class="tips">本节课表现总得分已超过100%的学生</text>
		</view>
		<view class="box">
			<u--image :showLoading="true" src="../../static/headers.png" width="446.04rpx" height="76rpx"
				radius="0"></u--image>
			<text>本节课教学内容</text>
		</view>
		<view class="centent_new">
			<view>
				<view class="headerView">
					<u--image :showLoading="true" src="../../static/suox.png" width="36rpx" height="42rpx"
						radius="0"></u--image>
					<text>视频回顾</text>
				</view>
				<video id="myVideo" :src="info.video"></video>
			</view>
			<view>
				<view class="headerView">
					<u--image :showLoading="true" src="../../static/suox.png" width="36rpx" height="42rpx"
						radius="0"></u--image>
					<text>本节课学到的新单词</text>
				</view>
				<text class="_text">{{info.word || ''}}</text>
			</view>
			<view>
				<view class="headerView">
					<u--image :showLoading="true" src="../../static/suox.png" width="36rpx" height="42rpx"
						radius="0"></u--image>
					<text>本节课所学课件</text>
				</view>
				<text class="_text">{{info.textbook_name || ''}}</text>
			</view>
			<view>
				<view class="headerView">
					<u--image :showLoading="true" src="../../static/suox.png" width="36rpx" height="42rpx"
						radius="0"></u--image>
					<text>下节课所学课件</text>
				</view>
				<text class="_text">{{info.next_textbook_name || ''}}</text>
			</view>
			<view style="margin-top:30rpx;">
				<view class="headerView">
					<u--image :showLoading="true" src="../../static/suox.png" width="36rpx" height="42rpx"
						radius="0"></u--image>
					<text>学习情况</text>
				</view>
			</view>
			<view>
				<view class="NewFlex" style="margin-top:10rpx;">
					<view class="View">
						<view :style="{backgroundColor:$store.state.primaryColor}"></view>
						<text>阅读评分</text>
					</view>
					<text
						class="typeText">{{parseInt(info.read_score) < 3 ? '表现普通' : parseInt(info.read_score) == 3 ? '表现中等' : '表现优异'}}</text>
				</view>
				<view class="line-progress">
					<u-line-progress :percentage="(parseInt(info.read_score) / 5) * 100" :showText="false" height="13"
						:activeColor="$store.state.primaryColor"></u-line-progress>
				</view>
			</view>
			<view>
				<view class="NewFlex" style="margin-top:40rpx;">
					<view class="View">
						<view :style="{backgroundColor:$store.state.primaryColor}"></view>
						<text>听力评分</text>
					</view>
					<text
						class="typeText">{{parseInt(info.listen_score) < 3 ? '表现普通' : parseInt(info.listen_score) == 3 ? '表现中等' : '表现优异'}}</text>
				</view>
				<view class="line-progress">
					<u-line-progress :percentage="(parseInt(info.listen_score) / 5) * 100" :showText="false" height="13"
						:activeColor="$store.state.primaryColor"></u-line-progress>
				</view>
			</view>
			<view>
				<view class="NewFlex" style="margin-top:40rpx;">
					<view class="View">
						<view :style="{backgroundColor:$store.state.primaryColor}"></view>
						<text>口语评分</text>
					</view>
					<text
						class="typeText">{{parseInt(info.speak_score) < 3 ? '表现普通' : parseInt(info.speak_score) == 3 ? '表现中等' : '表现优异'}}</text>
				</view>
				<view class="line-progress">
					<u-line-progress :percentage="(parseInt(info.speak_score) / 5) * 100" :showText="false" height="13"
						:activeColor="$store.state.primaryColor"></u-line-progress>
				</view>
			</view>
			<!-- <view>
				<view class="NewFlex" style="margin-top:40rpx;">
					<view class="View">
						<view :style="{backgroundColor:$store.state.primaryColor}"></view>
						<text>语法水平</text>
					</view>
					<text class="typeText">表现优异</text>
				</view>
				<view class="line-progress">
					<u-line-progress :percentage="30" :showText="false" height="13"
						:activeColor="$store.state.primaryColor"></u-line-progress>
				</view>
			</view> -->
			<view style="margin-top:50rpx;">
				<view class="headerView">
					<u--image :showLoading="true" src="../../static/suox.png" width="36rpx" height="42rpx"
						radius="0"></u--image>
					<text>教师评价</text>
				</view>
			</view>
			<view class="BoxItem">
				<view class="BoxOne">
					<u--image :showLoading="true" :src="info.teacher_info.avatar" width="96rpx" height="96rpx"
						radius="0" shape="circle"></u--image>
					<view class="BoxContent">
						<view class="BoxTop marginBottom">
							<text class="title">{{info.teacher_info.name || ''}}</text>
						</view>
						<view class="BoxTop">
							<text class="Newtitle">课堂表现</text>
							<u-rate :count="5" v-model="info.read_score" size="17" gutter="2"
								activeColor="#fb8000"></u-rate>
						</view>
					</view>
				</view>
				<view class="solid"></view>
				<view class="headers_title">
					<text>{{info.content || ''}}</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	import {
		reportInfo
	} from '../../api/Teacher.js';
	export default {
		data() {
			return {
				value: 3,
				info: {},
				req: {}
			}
		},
		onLoad(option) {
			if (option.hasOwnProperty('type')) {
				if (option.type == 'id') {
					this.req = {
						...{
							id: option.id
						}
					};
				}
			} else {
				this.req = {
					...{
						reservation_id: option.id
					}
				};
			}
			this.reportInfo();
		},
		methods: {
			/** 
			@method 查看报告
			**/
			async reportInfo() {
				try {
					const res = await reportInfo(this.req);
					this.info = {
						...res.data
					};
				} catch (err) {
					//TODO handle the exception
					console.log(err);
				}
			}
		}
	}
</script>
<style>
	page {
		width: 100%;
		height: auto;
		padding-bottom: 50rpx;
	}
</style>
<style scoped lang="scss">
	button::after {
		border: none;
	}

	.content {
		width: 100%;
		position: relative;

		#myVideo {
			width: 100%;
		}

		.headers_title {
			width: auto;
			margin: 0px auto;
			display: flex;
			margin-top: 20rpx;

			.view {
				width: 10rpx;
				height: 34rpx;
				background: #029CFE;
				border-radius: 6rpx;
			}

			.flex {
				display: flex;
				align-items: center;
			}

			text {
				width: 100%;
				word-wrap: break-word;
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #333333;
				margin-left: 5rpx;
				letter-spacing: 2rpx;
			}
		}

		.BoxItem {
			width: auto;
			background-color: #fff;
			border-radius: 10rpx;
			margin-top: 15rpx;

			.BoxOne {
				display: flex;
				// align-items: center;
				margin-top: 10rpx;

				.marginBottom {
					margin-bottom: 10rpx;
				}

				.BoxTop {
					margin-left: 20rpx;
					display: flex;
					align-items: center;

					text {
						display: block;
						font-size: 24rpx;
					}

					.title {
						font-family: PingFangSC, PingFang SC;
						font-weight: 600;
						font-size: 32rpx;
						color: #333333;
						font-style: normal;
					}

					.Newtitle {
						font-family: PingFangSC, PingFang SC;
						color: #999999;
						font-weight: 600;
						font-size: 28rpx;
						color: #FFB57A;
					}
				}
			}
		}

		.line-progress {
			width: 100%;
			margin: 0px auto;
		}

		.Flex {
			margin-top: 50rpx;

			.View {
				display: flex;
				align-items: center;
				margin-bottom: 20rpx;

				view {
					width: 18rpx;
					height: 18rpx;
					background: rgba(2, 156, 254, 0.52);
					border-radius: 50%;
				}

				text {
					margin-left: 15rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 500;
					font-size: 32rpx;
					color: #333333;
				}
			}
		}

		.NewFlex {
			margin-top: 50rpx;
			display: flex;
			justify-content: space-between;

			.typeText {
				font-family: PingFangSC, PingFang SC;
				font-weight: 500;
				font-size: 28rpx;
				color: #FFA35B;
			}

			.View {
				display: flex;
				align-items: center;
				margin-bottom: 20rpx;

				view {
					width: 18rpx;
					height: 18rpx;
					background: rgba(2, 156, 254, 0.52);
					border-radius: 50%;
				}

				text {
					margin-left: 15rpx;
					font-family: PingFangSC, PingFang SC;
					font-weight: 500;
					font-size: 28rpx;
					color: #666666;
				}
			}
		}

		.box {
			position: relative;

			text {
				font-family: PingFangSC, PingFang SC;
				font-weight: 600;
				font-size: 36rpx;
				color: #FFFFFF;
				position: absolute;
				top: 45rpx;
				left: 32%;
				letter-spacing: 2rpx;
			}

			/deep/ .u-image {
				display: block;
				margin: 0px auto;
				margin-top: 30rpx;
			}
		}

		._text {
			font-family: PingFangSC, PingFang SC;
			font-weight: 500;
			font-size: 28rpx;
			color: #666666;
			margin-top: 10rpx;
		}

		.centent_new {
			width: 85%;
			padding: 70rpx 20rpx 20rpx 20rpx;
			border-radius: 30rpx;
			margin: 0px auto;
			background-color: #fff;
			margin-top: -55rpx;

			.headerView {
				display: flex;
				align-items: center;
				margin-top: 20rpx;
				margin-bottom: 20rpx;

				text {
					font-family: PingFangSC, PingFang SC;
					font-weight: 600;
					font-size: 32rpx;
					color: #333333;
					margin-left: 10rpx;
				}
			}
		}

		.headers {
			width: 70%;
			height: auto;
			margin: 0px auto;
			padding: 20rpx 40rpx 25rpx 40rpx;
			background-color: #fe9f54;
			border-bottom-left-radius: 30rpx;
			border-bottom-right-radius: 30rpx;
			color: #fff;
			text-align: center;
			letter-spacing: 2rpx;
		}

		.jiangp {
			width: 100%;
			position: relative;

			/deep/ .u-image {
				display: block;
				margin: 0px auto;
			}

			text {
				display: block;
				color: #fff;
			}

			._text {
				font-family: AlimamaFangYuanTiVF-Bold, AlimamaFangYuanTiVF-Bold;
				font-weight: 600;
				font-size: 82rpx;
				color: #f95957;
				text-stroke: 2px rgba(255, 250, 213, 0.33);
				font-style: normal;
				-webkit-text-stroke: 2px rgba(255, 250, 213, 0.33);
				position: absolute;
				top: 105rpx;
				left: 43.5%;
			}

			.title {
				width: 100%;
				font-family: PingFangSC, PingFang SC;
				font-weight: 600;
				font-size: 36rpx;
				color: #FFFFFF;
				text-align: center;
				position: absolute;
				top: 355rpx;
				left: 2.5%;
				letter-spacing: 2rpx;
			}

			.tips {
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				font-size: 24rpx;
				color: #FFFFFF;
				text-align: center;
				letter-spacing: 2rpx;
			}
		}
	}
</style>